home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 4006 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.7 KB

  1. Path: informatik.tu-muenchen.de!fischerj
  2. From: fischerj@informatik.tu-muenchen.de (Juergen "Rally" Fischer)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: TMapping again!
  5. Date: 15 Feb 1996 17:29:10 GMT
  6. Organization: Technische Universitaet Muenchen, Germany
  7. Distribution: world
  8. Message-ID: <4fvqh6$na2@sunsystem5.informatik.tu-muenchen.de>
  9. References: <38232371@kone.fipnet.fi> <4fntd3$g56@sunsystem5.informatik.tu-muenchen.de> <38232442@kone.fipnet.fi>
  10. NNTP-Posting-Host: hphalle5.informatik.tu-muenchen.de
  11. Originator: fischerj@hphalle5.informatik.tu-muenchen.de
  12.  
  13.  
  14. In article <38232442@kone.fipnet.fi>, "Jyrki Saarinen" <jsaarinen@kone.fipnet.fi> writes:
  15. |> 
  16. |> > A ultraoptimized texturemapper uese no shading table.
  17. |> > even add-shading slows mapping down.
  18. |> > 
  19. |> > Imgagine 32 colors, each 8 shading-steps = 256 colors.
  20. |> 
  21. |> Yep. But how do you expect that a game for example can
  22. |> be made with n-1 textures, all sharing the same 32c palette?
  23.  
  24. n-1 ? my computer runs 15-1 MHz :)
  25. well, I guess a good gfx-man can do various textures with
  26. 32 colors. no scanned pictures of course ;)
  27.  
  28. |> 
  29. |> > move.w d1,d6
  30. |> > move.b d0,d6
  31. |> > move.l d6,a0
  32. |> > move.b (a0),d7
  33. |> > sub.b d5,d7       ;another 2 cycles
  34. |> > move.b d7,(a1)+   ;another 2 cycles
  35. |> > 
  36. |> > addx.l d2,d0 ;x
  37. |> > addx.l d3,d1 ;y
  38. |> > addx.l d4,d5 ;gouraud-alike color. ;another 2 cycles
  39. |> 
  40. |> Your sub.b d5,d7 trashs the X-flag .. better use or.b.
  41.  
  42. hehe, you got me, you see I never tested it.
  43. thanks for the hint.
  44.  
  45. |> 
  46. |> > no reg left for dbra loop. 2 more cycles in unrolled loop.
  47. |> > 
  48. |> > in inner-loop another 6 additional cycles compared to 
  49. |> > nonshaded mapping. +30%.
  50. |> 
  51. |> Hmm. I made once a mapper with 16c and 16 shades, all fitted
  52. |> to registers, add.l an,ax was used for V interpolation though,
  53. |> only 8 bits of fraction in V.
  54. |> 
  55. |> > I guess with table it's more like +70%.
  56. |> 
  57. |> Well. How many cycles the optimal mapper was?
  58. |> 
  59. |>         move.w  d1,d0
  60. |>         move.b  d2,d0
  61. |>         addx.l  d3,d1
  62. |>         move.l  d0,a0
  63. |>         addx.l  d4,d2
  64. |>         move.b  (a0),(a1)+
  65. |> 
  66. |> That is 17 cycles .. now, my Texture/Gouraud loop with
  67. |> a shading table, 256c and up to 256 shades is 30 020/030
  68. |> cycles, calculated the same way like that 17 cycles.
  69. |> 
  70. |> ~76% slower .. Quite a good guess.
  71. |> 
  72. |> But who cares, you wont do a game without any shading.
  73.  
  74. using much mem you can precalc the walls. and coppershade
  75. the floors (which are done with the 32x32 11cycle-mapper ;)
  76.  
  77. |> 
  78. |> > But maybe with using a special palette-setup you
  79. |> > can do tricks.
  80. |> 
  81. |> What kind of tricks .. I dont see a many of them.
  82.  
  83. argh the trick would need add or sub I guess :\
  84. And the trick probable would not be able to shade
  85. down to black...
  86.  
  87. imagine 32 colors going from yellow to dark red.
  88. color 31 would mean yellow, to shade sutract from 0 to 7.
  89. color 30 would be a less bright yellow, also available
  90. for the original texture. also sub 0-7.
  91. color 7 would be last available color, sub 0-7.
  92.  
  93. 24 colors at 8 brightneslevels using 32 colors, wow! :)
  94.  
  95. It might look a bit different, though ;)
  96.  
  97. |> 
  98. |> Btw, I took a new approach in making a Texture/Gouraud
  99. |> triangle routine; now it fits almost completely in 256b.
  100. |> Before it was much larger.
  101.  
  102. triangle ? only 3 points ? well, 1st outer loop (the one
  103. mapping horizontal) and 2nd outer (the one "parsing" the
  104. polygon from top to bottom) should fit into cache.
  105.  
  106. 3rd outer (recalculation at each polygon-edge the "parser" 
  107. hits doesn't need to be in cache. 
  108. Same goes for 4th outer "kind of init" or 5th outer "clip
  109. or whatever" :)
  110.  
  111. |> 
  112. |> --                               _
  113. |> a Stellar programmer          _ //
  114. |> "Amiga - back for the future" \X/
  115. ------------------------------------------------------------------------
  116.    fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer)   =:)
  117.  
  118.